Ext.define('Admin.view.employee.EmployeeEditForm', {
    extend: 'Ext.form.Panel',
    xtype:'employeeEditForm',
    requires: [
        'Ext.button.Button',
        'Ext.layout.container.*',
        'Ext.form.*'
    ],
     style: 'margin:10px',
    bodyPadding: 10,
    width:600,
    height:800,
    defaults: {
        labelWidth: 60,
        labelSeparator: ''
    },
    controller: 'employeeViewController',
    reader:{  
    type:'json',  
    model:'Admin.model.employee.EmployeeModel',  
    rootProperty : 'employee',  
    successProperty:'success'  
},items: [{
            xtype: 'container',
            anchor: '100%',
            layout:'column',
            items:[{
                xtype: 'container',
                columnWidth:.6,
                layout: 'anchor',
                    items: [{
                    xtype: 'hidden',//hidden
                   // fieldLabel: 'id',
                    name:'user.id'
                    },{
                    xtype: 'hidden',//hidden
                    //fieldLabel: 'id',
                    name:'idcardImg'
                    },{
                    xtype: 'hidden',//hidden
                    fieldLabel: 'empId',
                    name:'empId',
                    readOnly:true
                    },{
                        xtype: 'textfield',   
                        allowBlank: false,
                        maxLength: 10,
                        name: 'empName',
                        fieldLabel: '姓名',
                        blankText: '请输入姓名',
                        maxLengthText: '姓名不能超过10个字符'
                      },{
                        xtype:'radiogroup',
                        fieldLabel: '性别',
                        
                        style: 'padding-top:3px;height:17px;',
                        items: [{ name: 'sex', inputValue: 'male', boxLabel: '男', checked: true }, { name: 'sex', inputValue: 'female', boxLabel: '女'}]
                      },{
                       // hidden:true,
                        xtype: 'datefield',
                        fieldLabel: '出生日期',
                        name:'birthday',
                        format: 'Y/m/d'
                     },{
                        xtype:'combobox',
                    
                        allowBlank: false,
                        fieldLabel: '政治面貌',
                        store:{
                                fields: ['political', 'name'],
                                data: [['团员', '团员'], ['党员', '党员'], ['其他', '其他']]
                        },
                        displayField: 'name',
                        valueField: 'political',
                        name:'political',
                        triggerAction: 'all',
                        emptyText: '请选择...',
                        blankText: '请选择政治面貌',
                        editable: false,
                        mode: 'local' 
                      },{
                        xtype: 'textfield',     
                        
                        allowBlank: false,
                        name: 'ethnic',
                        fieldLabel: '民族',
                         blankText: '请输入民族'
                      },{
                        xtype: 'textfield',     
                        
                        allowBlank: false,
                        name: 'education',
                        fieldLabel: '学历',
                        blankText: '请输入学历'
                      },{
                        xtype: 'textfield',     
                    
                        maxLength: 18,
                        allowBlank: false,
                        name: 'idcard',
                        fieldLabel: '身份证',
                        blankText: '请输入身份证',
                        maxLengthText: '18位数身份证'
                      },{   
                        xtype: 'textfield',     
                    
                       // allowBlank: false,
                        name: 'phone',
                        fieldLabel: '联系电话'
                                 
                      },{   
                        xtype: 'textfield',     
                    
                       // allowBlank: false,
                        name: 'email',
                        fieldLabel: '邮箱'
                                 
                      },{
                    
                        xtype: 'textfield',
                       // allowBlank: false,
                        name: 'bornPlace',
                        fieldLabel: '出生地'
                     },{
                        xtype: 'textfield',
                        //allowBlank: false,
                        name: 'address',
                        fieldLabel: '联系地址'
        
                    },{
                        hidden:true,
                        xtype: 'datefield',
                        fieldLabel: '入职时间',
                        name:'joinTime',
                        format: 'Y/m/d'
                     } ]
            }]
            
            
        }],

        buttons: [{
            text: 'submit',
            handler:'submitEditForm'
        },{
            text: 'Cancel',
            handler :function(bt){
            var win = bt.up('window');
            if (win) {
                win.close();
            }
          }
        }]
    
});